PROJECT(rosmsg)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
set(CMAKE_CXX_FLAGS "-std=c++11")


FIND_PACKAGE(catkin REQUIRED COMPONENTS
	message_generation
	message_runtime
	roscpp
	rospy
	std_msgs
	std_srvs
)

add_message_files(
	DIRECTORY srvAndMsg
	FILES
	gps.msg
	route.msg
)

# add_service_files(
# 	DIRECTORY srvAndMsg
# 	FILES
# 	gpsPath.srv
# )

generate_messages(DEPENDENCIES
	std_msgs
)

INCLUDE_DIRECTORIES(
	${catkin_INCLUDE_DIRS}
	./driver/
	./driver/include/
)

LINK_DIRECTORIES(./driver/lib/)
AUX_SOURCE_DIRECTORY(./driver/ DIR_SRCS)

ADD_EXECUTABLE(tank ${DIR_SRCS} ./app/tank.cpp ./app/control.cpp)
ADD_EXECUTABLE(tele_tank_key ./app/teleop_tank_key)

ADD_DEPENDENCIES(tank ${PROJECT_NAME}_generate_messages_cpp)
TARGET_LINK_LIBRARIES(tank ${catkin_LIBRARIES} -lrplidar_sdk -lpthread)

TARGET_LINK_LIBRARIES(tele_tank_key ${catkin_LIBRARIES})